/**
 * Project Name:HomeActivity
 * Date:2016-7-4下午4:04:33
 * Copyright (c) 2016, askzhao All Rights Reserved.
 *
 */
package com.kkd.kkdapp.activity;

import java.util.ArrayList;
import java.util.List;

import android.app.Dialog;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.FragmentTransaction;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TabWidget;
import android.widget.TextView;

import com.google.gson.Gson;
import com.kkd.kkdapp.R;
import com.kkd.kkdapp.base.BaseActivity;
import com.kkd.kkdapp.fragment.SanbiaoFrame;
import com.kkd.kkdapp.fragment.ZhaiquanFrame;
import com.kkd.kkdapp.http.entity.Home;
import com.kkd.kkdapp.http.entity.selectedGroup;
import com.kkd.kkdapp.http.manager.HttpCallBack;
import com.kkd.kkdapp.http.manager.KkdHttpMagager;
import com.kkd.kkdapp.listener.OnSingleClickListener;
import com.kkd.kkdapp.utils.DialogUtils;
import com.kkd.kkdapp.utils.PreferenceUtils;
import com.kkd.kkdapp.view.iphoneTree.IphoneTreeView;
import com.kkd.kkdapp.view.iphoneTree.IphoneTreeView.IphoneTreeHeaderAdapter;
import com.kkd.kkdapp.view.iphoneTree.SelectedBidTreeViewAdapter;

/**
 * ClassName: SelectedBidActivity <br/>
 * date: 2016-7-4 下午4:04:33 <br/>
 * 推荐标的列表
 * 
 * @author askzhao
 * @version
 */
public class SelectedBidActivity extends BaseActivity {

	
	private RelativeLayout back;
	private TextView groupTv1;
	private TextView groupTv2;
	private FrameLayout mSanbiaoFrameLayout;
	private FrameLayout mZhaiquanFrameLayout;
	private SanbiaoFrame mSanbiaoFrame = new SanbiaoFrame();
	private ZhaiquanFrame mZhaiquanFrame = new ZhaiquanFrame();
	
	private OnSingleClickListener mOnSingleClickListener = new OnSingleClickListener() {

		@Override
		public void onSingleClick(View v) {
			switch (v.getId()) {
			case R.id.back:
				finish();
				break;

			default:
				break;
			}

		}
	};

	

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_selected_bid);
		back = (RelativeLayout) findViewById(R.id.back);
		back.setOnClickListener(mOnSingleClickListener);
		mSanbiaoFrameLayout = (FrameLayout) findViewById(R.id.sanbiao_frame);
		mZhaiquanFrameLayout = (FrameLayout) findViewById(R.id.zhaiquan_frame);
		groupTv1 = (TextView) findViewById(R.id.group1);
		groupTv1.setSelected(true);
		groupTv2 = (TextView) findViewById(R.id.group2);
		groupTv2.setSelected(false);
		groupTv1.setOnClickListener(new OnSingleClickListener() {

			@Override
			public void onSingleClick(View v) {
				groupTv1.setSelected(true);
				groupTv2.setSelected(false);
				mSanbiaoFrameLayout.setVisibility(View.VISIBLE);
				mZhaiquanFrameLayout.setVisibility(View.GONE);
			}
		});
		groupTv2.setOnClickListener(new OnSingleClickListener() {

			@Override
			public void onSingleClick(View v) {
				groupTv1.setSelected(false);
				groupTv2.setSelected(true);
				mSanbiaoFrameLayout.setVisibility(View.GONE);
				mZhaiquanFrameLayout.setVisibility(View.VISIBLE);

			}
		});
		initFragmentView();
	}

	
	
	public void initFragmentView() {
		FragmentTransaction tran = getSupportFragmentManager()
				.beginTransaction();
		tran.replace(R.id.sanbiao_frame, mSanbiaoFrame);
		tran.replace(R.id.zhaiquan_frame, mZhaiquanFrame);
		tran.commit();
	}
}
